package com.ruoyi.reward.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.reward.mapper.CommunityOrderMapper;
import com.ruoyi.reward.domain.CommunityOrder;
import com.ruoyi.reward.service.ICommunityOrderService;

/**
 * 兑换订单Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-04
 */
@Service
public class CommunityOrderServiceImpl implements ICommunityOrderService 
{
    @Autowired
    private CommunityOrderMapper communityOrderMapper;

    /**
     * 查询兑换订单
     * 
     * @param id 兑换订单主键
     * @return 兑换订单
     */
    @Override
    public CommunityOrder selectCommunityOrderById(Long id)
    {
        return communityOrderMapper.selectCommunityOrderById(id);
    }

    @Override
    public void checkcode(Long id) {
        communityOrderMapper.checkcode(id);
    }

    /**
     * 查询兑换订单列表
     * 
     * @param communityOrder 兑换订单
     * @return 兑换订单
     */
    @Override
    public List<CommunityOrder> selectCommunityOrderList(CommunityOrder communityOrder)
    {
        return communityOrderMapper.selectCommunityOrderList(communityOrder);
    }

    /**
     * 新增兑换订单
     * 
     * @param communityOrder 兑换订单
     * @return 结果
     */
    @Override
    public int insertCommunityOrder(CommunityOrder communityOrder)
    {
        communityOrder.setCreateTime(DateUtils.getNowDate());
        return communityOrderMapper.insertCommunityOrder(communityOrder);
    }

    /**
     * 修改兑换订单
     * 
     * @param communityOrder 兑换订单
     * @return 结果
     */
    @Override
    public int updateCommunityOrder(CommunityOrder communityOrder)
    {
        return communityOrderMapper.updateCommunityOrder(communityOrder);
    }

    /**
     * 批量删除兑换订单
     * 
     * @param ids 需要删除的兑换订单主键
     * @return 结果
     */
    @Override
    public int deleteCommunityOrderByIds(Long[] ids)
    {
        return communityOrderMapper.deleteCommunityOrderByIds(ids);
    }

    /**
     * 删除兑换订单信息
     * 
     * @param id 兑换订单主键
     * @return 结果
     */
    @Override
    public int deleteCommunityOrderById(Long id)
    {
        return communityOrderMapper.deleteCommunityOrderById(id);
    }
}
